Repository navigation
Conversation
to_a2a() set the "google_adk" logger to INFO on every call, so a level the application configured before building the app (for example with `uvicorn --log-config`) was silently replaced: DEBUG logs disappeared and a WARNING setting started letting INFO through. The override did not make logs visible under plain uvicorn either: uvicorn's default config adds no root handler, so ADK INFO records were dropped with or without it. Leave the level to the application. Fixes google#7462
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to Issue or Description of Change
1. Link to an existing issue (if applicable):
Problem:
to_a2a()sets thegoogle_adklogger to INFO every time it's called. Any level the application configured beforehand gets overwritten, e.g. auvicorn --log-configthat setsgoogle_adkto DEBUG loses all ADK debug output once the module callsto_a2a(), and a WARNING level starts letting INFO through again.The comment said the call was there so logs show up when running under uvicorn directly, but uvicorn's default config doesn't attach a root handler, so ADK INFO records weren't printed with or without it.
Solution:
Remove the
setLevelcall and leave log levels to the application. Theadk_loggervariable stays since two warnings further down still use it.One behavior change to be aware of: an app that sets up its own root handler but never sets a level on
google_adkwill no longer see ADK's INFO lines after callingto_a2a(). That matches what the app configured, but if you'd prefer to keep INFO as a default, I can change this to only set the level whengoogle_adkis stillNOTSET.Testing Plan
Unit Tests:
Added
test_to_a2a_keeps_configured_adk_log_level. It fails on main (assert 20 == 30, i.e. INFO instead of WARNING) and passes with the fix.Manual End-to-End (E2E) Tests:
A small module that logs at DEBUG before and after calling
to_a2a(), served with uvicorn and a log config that setsgoogle_adkto DEBUG:Before the fix:
After the fix:
Checklist